#!/bin/bash
if [ $# -lt 1 ]
then
  echo "start or stop???"
  exit
fi

case $1 in
start)
	ssh hadoop202 sudo systemctl start zabbix-server zabbix-agent httpd rh-php72-php-fpm && sudo systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm;
	ssh hadoop203 sudo systemctl start zabbix-agent && sudo systemctl enable zabbix-agent;
	ssh hadoop204 sudo systemctl start zabbix-agent && sudo systemctl enable zabbix-agent;
;;
stop)
	ssh hadoop202 sudo systemctl stop zabbix-server zabbix-agent httpd rh-php72-php-fpm && sudo systemctl disable zabbix-server zabbix-agent httpd rh-php72-php-fpm;
	ssh hadoop203 sudo systemctl stop  zabbix-agent && sudo systemctl disable zabbix-agent;
	ssh hadoop204 sudo systemctl stop zabbix-agent && sudo systemctl disable zabbix-agent;
;;
*)
  echo "args is error"
;;
esac